trigger prvntEmailDuplicate on Account (before insert, before update) {

list<account> lall = [select email__c from account where email__c <>null];
List<account> la = Trigger.New;
List<account> ln = new List<account>();

for(Account acc : la)
{
for(Account ac : la)
{
if(acc.id != ac.id && acc.email__c == ac.email__c)
system.debug(acc.email__c);
// ln.add(acc);
}
}
/* for(Account a:ln){
 for(Account a1:lall){
 if(a.email__c == a1.email__c)
 {
 if(Trigger.isupdate)
 {
 if(a.email__c <> Trigger.oldMap.get(a.id).email__c)
 {
  a.adderror('Email is found duplicate');
 }
 }
 else if(Trigger.isinsert)
 {
 a.adderror('Email is found duplicate');
 }
 }
 }
} */
}